package model.core;

import model.effects.Effect;
import utility.BidirectionalMap;

public class EffectsLibrary {
	private BidirectionalMap<String, Effect> library = new BidirectionalMap<String, Effect>();
	
	private static EffectsLibrary effectsLibrary = null;
	
	private EffectsLibrary(){
		
	}
	
	public static EffectsLibrary getInstance(){
		if (effectsLibrary == null){
			effectsLibrary = new EffectsLibrary();
		}
		return effectsLibrary;
	}
	
	public Effect getEffect(String name){
		return library.getFromSecondSet(name).clone();
	}
	
	public String getName(Effect eff){
		return library.getFromFirstSet(eff);
	}
	
	public void put(String name, Effect eff){
		library.put(name, eff);
	}
}

